package com.cnap.model.schedule.engine;

import com.cnap.model.schedule.ClusterDetail;

/**
 * 算法引擎-集群信息
 *
 * @author xc
 **/
public class EngineClusterInfo {
    // 名称
    private String name;
    // 服务商
    private String providerName;
    // ip
    private String ip;
    // 内部ip
    private String innerIp;
    // 实际部署标志
    private boolean active;

    /**
     * get
     *
     * @return Active
     */
    public boolean isActive() {
        return active;
    }

    /**
     * set
     *
     * @param active active
     */
    public void setActive(boolean active) {
        this.active = active;
    }

    /**
     * get
     *
     * @return Name
     */
    public String getName() {
        return name;
    }

    /**
     * set
     *
     * @param name name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * get
     *
     * @return ProviderName
     */
    public String getProviderName() {
        return providerName;
    }

    /**
     * set
     *
     * @param providerName providerName
     */
    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    /**
     * get
     *
     * @return Ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * set
     *
     * @param ip ip
     */
    public void setIp(String ip) {
        this.ip = ip;
    }

    /**
     * get
     *
     * @return InnerIp
     */
    public String getInnerIp() {
        return innerIp;
    }

    /**
     * set
     *
     * @param innerIp innerIp
     */
    public void setInnerIp(String innerIp) {
        this.innerIp = innerIp;
    }

    @Override
    public String toString() {
        return "EngineClusterInfo{" +
                "name='" + name + '\'' +
                ", providerName='" + providerName + '\'' +
                ", ip='" + ip + '\'' +
                ", innerIp='" + innerIp + '\'' +
                '}';
    }

    /**
     * 转换模型
     *
     * @return 结果
     */
    public ClusterDetail toDetail() {
        ClusterDetail detail = new ClusterDetail();
        detail.setClusterName(name);
        detail.setIp(ip);
        return detail;
    }
}
